// pages/trainList/trainList.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    date:'',
    trainlist:[{
      startStation:'哈尔滨',
      endStation:'北京',
      code:'DD28',
      duration:'7小时54分',
      starttime:'06:57',
      endtime:'14:51',
      price:'306.5',
      remarks:'可抢票',
      onenum:'10',
      twonum:'20'
    }, {
        startStation: '哈尔滨',
        endStation: '北京',
        code: 'DD28',
        duration: '7小时54分',
        starttime: '06:57',
        endtime: '14:51',
        price: '306.5',
        remarks: '可抢票',
        onenum: '10',
        twonum: '20'
      }, {
        startStation: '哈尔滨',
        endStation: '北京',
        code: 'DD28',
        duration: '7小时54分',
        starttime: '06:57',
        endtime: '14:51',
        price: '306.5',
        remarks: '可抢票',
        onenum: '10',
        twonum: '20'
      }, {
        startStation: '哈尔滨',
        endStation: '北京',
        code: 'DD28',
        duration: '7小时54分',
        starttime: '06:57',
        endtime: '14:51',
        price: '306.5',
        remarks: '可抢票',
        onenum: '10',
        twonum: '20'
      }, {
        startStation: '哈尔滨',
        endStation: '北京',
        code: 'DD28',
        duration: '7小时54分',
        starttime: '06:57',
        endtime: '14:51',
        price: '306.5',
        remarks: '可抢票',
        onenum: '10',
        twonum: '20'
      }],
    currentTab:"1"

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var startStation=options.startStation;
    var endStation=options.endStation;
    var date=options.date;
    console.log("startStation="+startStation+"&endStation="+endStation+"&date="+date);
    wx.setNavigationBarTitle({
      title:startStation+"→"+endStation
    });
    this.setData({
      date:date,
    })
  },


  switchNav:function(e){
    var id=e.currentTarget.id;
    this.setData({
      currentTab:id
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})